package com.wechat.controller;

import com.alibaba.fastjson.JSONObject;
import com.fh.modules.ems.vo.PushProductQryVo;
import com.fhMall.request.QueryEmsHomeBannerRequest;
import com.fhMall.request.QueryEmsHomePushProductRequest;
import com.wechat.feign.FhEmallHomeApi;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 
 *
 * @author 
 * @date 2019-09-18 20:00:31
 */
@RestController
@RequestMapping("/wechat/home")
@Api(tags = "")
public class WechatHomeController extends BaseController{

    @Autowired
    private FhEmallHomeApi fhEmallHomeApi;

    /**
     * 查询首页banner广告
     * @return 首页banner广告
     */
    @ApiOperation(value="查询首页banner广告")
    @GetMapping(value = "/emsHomeBanner/queryAll")
    public JSONObject queryEmsHomeBannerAll( QueryEmsHomeBannerRequest queryEmsHomeBannerRequest) {
        String result = fhEmallHomeApi.queryEmsHomeBannerAll(queryEmsHomeBannerRequest);
        return JSONObject.parseObject(result);
    }

    /**
     * 查询微商城商品分类
     * @return 微商城商品分类
     */
    @ApiOperation(value="查询微商城商品分类")
    @GetMapping(value = "/pmsProductCategory/queryAll")
    public JSONObject queryPmsProductCategoryAll() {
        String result = fhEmallHomeApi.queryPmsProductCategoryAll();
        return JSONObject.parseObject(result);
    }

    /**
     * 查询推荐商品
     * @return 推荐商品
     */
    @ApiOperation(value="查询推荐商品")
    @GetMapping(value = "/emsHomePushProduct/queryAll")
    public JSONObject queryEmsHomePushProductAll( PushProductQryVo vo) {
        String result = fhEmallHomeApi.queryEmsHomePushProductAll(vo);
        return JSONObject.parseObject(result);
    }


    /**
     * 查询商品的属性
     * @return 商品的属性
     */
    @ApiOperation(value="查询商品的属性")
    @GetMapping(value = "/pmsProduct/queryProductProperty")
    public JSONObject queryProductProperty(@RequestParam(name="id") Integer id) {
        String result = fhEmallHomeApi.queryProductProperty(id);
        return JSONObject.parseObject(result);
    }


}
